import { createRouter, createWebHashHistory } from 'vue-router';
import Login from "@/views/login.vue";
import adminIndex from "@/views/adminIndex.vue";
import user from "@/views/admin/user.vue";
import decisionConsulting from "@/views/admin/decisionConsulting.vue";
import creativeAchievement from "@/views/admin/creativeAchievement.vue";
import intellectualProperty from "@/views/admin/intellectualProperty.vue";
import totalWork from "@/views/admin/totalWork.vue";
import researchProject from "@/views/admin/researchProject.vue";
import academicWorks from "@/views/admin/academicWorks.vue";
import userIndex from '@/views/userIndex.vue';
import personal from '@/views/user/personal.vue';
import researchProjectUser from '@/views/user/researchProjectUser.vue';
import totalWorkUser from '@/views/user/totalWorkUser.vue';
import academicWorksUser from '@/views/user/academicWorksUser.vue'
// import ordersList from '@/views/user/ordersList.vue';
// import register from '@/views/user/register.vue';
// import collection from '@/views/user/collection.vue';

const routes = [
  {
    path: "/",
    redirect: "/login",
  },
  {
    path: "/login",
    name: "login",
    component: Login,
  },
  // {
  //   path: "/register",
  //   name: "register",
  //   component: register,
  // },
  {
    path: "/adminIndex",
    name: "adminIndex",
    component: adminIndex,
    children: [
      {
        path: "user",
        name: "user",
        meta: { title: '用户管理' },
        component: user,
      },
      {
        path: "totalWork",
        name: "totalWork",
        meta: { title: '总工作量' },
        component: totalWork,
      },
      {
        path: "researchProject",
        name: "researchProject",
        meta: { title: '科研项目工作量' },
        component: researchProject,
      },
      {
        path: "academicWorks",
        name: "academicWorks",
        meta: { title: '学术著作' },
        component: academicWorks,
      },
      {
        path: "decisionConsulting",
        name: "decisionConsulting",
        meta: { title: '决策咨询类' },
        component: decisionConsulting,
      },
      {
        path: "creativeAchievement",
        name: "creativeAchievement",
        meta: { title: '创作成果类' },
        component: creativeAchievement,
      },
      {
        path: "intellectualProperty",
        name: "intellectualProperty",
        meta: { title: '知识产权类' },
        component: intellectualProperty,
      }
    ],
  },
  {
    path: "/userIndex",
    name: "userIndex",
    component: userIndex,
    children: [
      {
        path: "personal",
        name: "personal",
        meta: { title: '个人中心' },
        component: personal,
      },
      {
        path: "totalWorkUser",
        name: "totalWorkUser",
        meta: { title: '总工作量' },
        component: totalWorkUser,
      },
      {
        path: "researchProjectUser",
        name: "researchProjectUser",
        meta: { title: '科研工作量' },
        component: researchProjectUser,
      },
      {
        path: "academicWorksUser",
        name: "academicWorksUser",
        meta: { title: '学术著作' },
        component: academicWorksUser,
      },
  //     {
  //       path: "collection",
  //       name: "collection",
  //       meta: { title: '我的收藏' },
  //       component: collection,
  //     }
    ],
  }
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export default router;

